﻿<KCtl:BaseUserControl xmlns:my="clr-namespace:Kiva7.Pages"  x:Class="Kiva7.Pages.LoanImageControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:KCtl="clr-namespace:Kiva7.Controls"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    d:DesignHeight="480" d:DesignWidth="700">

    <Grid>

        <ProgressBar Visibility="{Binding IsLoaded, Converter={StaticResource booleanToNotVisibility}}" 
                     IsIndeterminate="{Binding IsLoaded, Converter={StaticResource notBooleanConverter}}" 
                     Style="{StaticResource CustomIndeterminateProgressBar}"
                     VerticalAlignment="Center" />

        <ScrollViewer Visibility="{Binding IsLoaded, Converter={StaticResource booleanToVisibility}}">

            <StackPanel x:Name="LayoutRoot" Background="{StaticResource KivaBackgroundBrush}"
                        DataContext="{Binding SingleData}">
                <StackPanel Style="{StaticResource KivaPanelTextLargeStyle}" Margin="12,0,0,0">
                    <TextBlock Text="{Binding Name}" Style="{StaticResource KivaTextLargeStyle}"
                           TextWrapping="Wrap"/>
                </StackPanel>

                <TextBlock x:Name="LoanID" Text="{Binding ID}" Visibility="Collapsed"/>

                <KCtl:OrientedStackPanel OrientationL="Horizontal" WidthL="600"
                                         OrientationP="Vertical"   WidthP="456">
                    <Button Click="Button_Click" BorderThickness="0" Margin="0,0,0,0" VerticalAlignment="Top">
                        <KCtl:KivaImageControl x:Name="imgLender" ImageSize="Normal" ImageData="{Binding Image}" 
                                           KCtl:PhonePage.WidthP="318" 
                                           KCtl:PhonePage.WidthL="180" 
                                           Height="240"/>
                    </Button>

                    <StackPanel Style="{StaticResource KivaDetailStyle}"
                                KCtl:PhonePage.WidthP="456" 
                                KCtl:PhonePage.WidthL="384">
                        <KCtl:TranslationControl x:Name="useTranslation" DataContext="{Binding Description.Texts.Translation}" />
                    </StackPanel>
                    <my:MediaControl x:Name="media" DataContext="{Binding Description.Texts.Translation}" />
                </KCtl:OrientedStackPanel>
                
            </StackPanel>
        </ScrollViewer>


    </Grid>
</KCtl:BaseUserControl>
